package week2;


public class PolyLine {
	//should be array of points for ordering
	double [] xpoints, ypoints;
	int npoints;
	
	//this is my constructor for PolyLine class
		public PolyLine(double [] xpoints, double [] ypoints, int npoints){
					
			this.xpoints = xpoints;
			this.ypoints = ypoints;
			this.npoints = npoints;
		
		}
		
		//Setting some methods for PolyLine class
		//this creates a new bigger array to store the new userPoint		
		public void addPoint(double userX, double userY){
			double [] xtemp = new double[npoints+1];
			double [] ytemp = new double[npoints+1];
			
			for (int i=0; i<npoints; i++){
			xtemp[i] = xpoints[i];
			ytemp[i] = ypoints[i];
			}			
			xtemp[npoints] = userX;
			ytemp[npoints] = userY;
			
			xpoints=xtemp;
			ypoints=ytemp;
			npoints=npoints+1;
			
		}
}
